<!DOCTYPE html>
<html>
{% load staticfiles %}
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <link href="{% static 'css/bootstrap.min14ed.css' %}" rel="stylesheet">
    <link href="{% static 'css/font-awesome.min93e3.css' %}" rel="stylesheet">
    <!-- Morris -->
    <link href="{% static 'css/plugins/morris/morris-0.4.3.min.css' %}" rel="stylesheet">
    <!-- Gritter -->
    <link href="{% static 'js/plugins/gritter/jquery.gritter.css' %}" rel="stylesheet">
    <link href="{% static 'css/animate.min.css' %}" rel="stylesheet">
    <link href="{% static 'css/style.min862f.css' %}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>爬虫爬取关键词</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    {% if user.is_staff %}
                        <div class="row">
                            <form action="{% url 'backms:index' %}" method="post">
                                <div class="col-sm-6">
                                    <p class="text-info">{{ msg_good }}</p>
                                    <p class="text-danger">{{ msg_bad }}</p>
                                    <div class="input-group">
                                        <input name="key_words" required="required" type="text" placeholder="添加主题"
                                               class="input-sm form-control">
                                        <span class="input-group-btn">
                                            <button type="submit" class="btn btn-sm btn-primary">添加 </button>
                                        </span>
                                    </div>
                                </div>
                                {% csrf_token %}
                            </form>
                        </div>
                    {% endif %}
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <form action="{% url 'backms:compare' %}" method="get">

                                <thead>
                                <tr>
                                    <th></th>
                                    <th>关键词</th>
                                    <th>添加人</th>
                                    <th>添加日期</th>
                                    <th>
                                        <button type="submit" class="btn btn-sm btn-info">进行对比</button>
                                    </th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for title in need_title %}
                                    <tr>
                                        <td>
                                            <div class="icheckbox_square-green checked" style="position: relative;">
                                                <input
                                                        type="checkbox" checked="" class="i-checks" name="input[]"
                                                        style="position: absolute; opacity: 0;">
                                                <ins class="iCheck-helper"
                                                     style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins>
                                            </div>
                                        </td>
                                        <td>
                                            <a href="{% url 'backms:graph' %}?title={{ title.key_words }}"
                                               target="_blank">{{ title.key_words }}</a>
                                        </td>
                                        <td>{{ title.add_user }}</td>
                                        <td>{{ title.create_time }}</td>
                                        <td>
                                            <label class="checkbox-inline">
                                                <input type="checkbox" value="{{ title.key_words }}"
                                                       name="compare_check_box">添加对比</label>
                                        </td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </form>
                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
<script src="{% static 'js/jquery.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/plugins/flot/jquery.flot.js' %}"></script>
<script src="{% static 'js/plugins/flot/jquery.flot.tooltip.min.js' %}"></script>
<script src="{% static 'js/plugins/flot/jquery.flot.spline.js' %}"></script>
<script src="{% static 'js/plugins/flot/jquery.flot.resize.js' %}"></script>
<script src="{% static 'js/plugins/flot/jquery.flot.pie.js' %}"></script>
<script src="{% static 'js/plugins/flot/jquery.flot.symbol.js' %}"></script>
<script src="{% static 'js/plugins/peity/jquery.peity.min.js' %}"></script>
<script src="{% static 'js/demo/peity-demo.min.js' %}"></script>
<script src="{% static 'js/content.min.js' %}"></script>
<script src="{% static 'js/plugins/jquery-ui/jquery-ui.min.js' %}"></script>
<script src="{% static 'js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js' %}"></script>
<script src="{% static 'js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js' %}"></script>
<script src="{% static 'js/plugins/easypiechart/jquery.easypiechart.js' %}"></script>
<script src="{% static 'js/plugins/sparkline/jquery.sparkline.min.js' %}"></script>
<script src="{% static 'js/demo/sparkline-demo.min.js' %}"></script>
<script src="{% static 'js/plugins/iCheck/icheck.min.js' %}"></script>

</body>
</html>
